﻿namespace SampleWeb;

public static class AppConfig
{
    public const string Branch = "Known";
    public const string SubTitle = "基于Blazor的企业级快速开发框架";
    public static string AppId => "KIMS";
    public static string AppName => "Known信息管理系统";

    public static void AddApplication(this IServiceCollection services, Action<CoreOption> action = null)
    {
        //Stopwatcher.Enabled = true;
        Console.WriteLine(AppName);
        var assembly = typeof(AppConfig).Assembly;
        services.AddKnown(info =>
        {
            //项目ID、名称、类型、程序集
            info.Id = AppId;
            info.Name = AppName;
            info.Assembly = assembly;
        });
        services.AddKnownWeb(action);
    }

    public static void UseApplication(this WebApplication app)
    {
        app.UseKnown();
    }
}